package com.bs.framework.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author jiangfeng
 * @version 1.0
 * @date 2020-07-05 13:19
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Value("${bs.staticAccessPath}")
    private String staticAccessPath;
    @Value("${bs.profile}")
    private String profile;


    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler(staticAccessPath).addResourceLocations(("file:" + profile));
    }
}
